package top.milkbox.service;

import top.milkbox.domain.PostCollection;
import com.baomidou.mybatisplus.extension.service.IService;

/**
* @author xiaoguo
* @description 针对表【tb_post_collection(收藏表)】的数据库操作Service
* @createDate 2022-11-22 18:07:06
*/
public interface PostCollectionService extends IService<PostCollection> {

    // 收藏
    public abstract boolean collection(String token, int postId);

    // 取消收藏
    public abstract boolean cancelCollection(String token, int postId);

    /**
     * 用户是否给某个帖子收藏了
     *
     * @param userId 用户id
     * @param postId 帖子id
     * @return 如果收藏了返回true
     */
    public abstract boolean isCollection(int userId, int postId);
}
